package com.作业.Day12;

import java.util.Arrays;
import java.util.List;

/**
 * 用工具类Arrays.asList()将数组转换成List
 *
 *
 */
public class Homework3 {
    public static void main(String[] args) {
        Student s1 =new Student("张三", 18);
        Student s2 = new Student("李四", 18);
        Student s3 = new Student("王五", 18);
        Student []students={
                s1,s2,s3
        };
        List<Student> list = Arrays.asList(students);
        for (Student student : list) {
            System.out.println( student);
        }
    }
}
